using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace FitnessCenter.DataAccessLayer.DataModels
{
    [Table("Person")]
    public class Person
    {
        public Person()
        {
            Activity = new HashSet<Activity>();
            ActivityLog = new HashSet<ActivityLog>();
            Subscribtion = new HashSet<Subscribtion>();
        }

        public int PersonID { get; set; }

        [Required]
        [StringLength(500)]
        public string FirstName { get; set; }

        [Required]
        [StringLength(500)]
        public string LastName { get; set; }

        [Required]
        [StringLength(500)]
        public string ThirdName { get; set; }

        public bool IsCoach { get; set; }

        public virtual ICollection<Activity> Activity { get; set; }

        public virtual ICollection<ActivityLog> ActivityLog { get; set; }

        public virtual ICollection<Subscribtion> Subscribtion { get; set; }

        public override string ToString()
        {
            return string.Concat(FirstName, LastName, ThirdName);
        }
    }
}
